<?php
/**
 * @author Mingming Tang iamalazyrat@gmail.com
 */

class Product extends Base{

  public static $timestamps   =   true;

  public static $table        =   'products';

  public static $accessible   =   array('volumn', 'unique_id', 'pic_url', 'title', 'description', 'url','price', 'coupon_start_time', 'coupon_end_time', 'coupon_price', 'coupon_rate', 'mall');

  public function tags() {
    return $this->has_many_and_belongs_to('Tag', 'product_tag');
  }

  public function categories() {
    return $this->has_many_and_belongs_to('Category', 'category_product');
  }
    
}
